﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master1.Master" AutoEventWireup="true" CodeBehind="SearchPage.aspx.cs" Inherits="TienTeTuong.SearchPage" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">
    <div>
                    	<div class="mainTitle">Kết quả tìm kiếm - <%= iTotalResult %> Kết quả</div>
                        <div class="mainBrowse">Trở về: <a href="Home.aspx">Trang chủ</a></div>
                        <div class="Content mainProduct">
                        <!-- Products -->

                        	<div class="mainProductList">
                                    <%if (lstCateDetail.Count < 1)
                                  { %>
                                        <center><h4>Không tìm thấy kết quả nào.</h4></center>
                                      
                                <% 
                                  } %>
                                <% foreach (var val in lstCateDetail)
                                   {
                                       maxPerline++;
                                    %>
                            	<div class="mainProductTD"><table width="100%" cellpadding="0" cellspacing="0">
                                	<tr><td class="mainProductTDImg"><a href="productDetail.aspx?CateDetailID=<%=val.CateDetailID %>&CateID=<%=cateID %>"><img src="<%=val.Image %>"/></a></td></tr>
                                    <tr><td class="Title"><a href="productDetail.aspx?CateDetailID=<%=val.CateDetailID %>&CateID=<%=cateID %>"><%=val.Name %></a></td></tr>
                                    <tr><td class="mainProductTDPrice"><div class="productPrice"><span><%=TienTeTuong.Common.DisplayAsMoney(val.Price.ToString()) %></span> VNĐ</div></td></tr>
                                    <tr><td class="mainProductTDButton">
                                    	<div class="btnCart"><div class="btnCartBg"><a href="#">Mua ngay</a></div></div>
                                    	<div class="clear"></div>
                                    </td></tr>
                                </table></div>
                                <% if (maxPerline < 3){%>

                                <div class="mainProductTDSpace"></div>
                                <% } %>

                                 <% if (maxPerline == 3)
                                   {
                                      maxPerline = 0; %>
                                     <div class="clear"></div>
                                 <% } %>

                                <% }
%>
     
                            </div>
                            <!--Paging-->
                            <%if (iTotalPage > 1)
                              {%>
                               <div class="clear"></div>
                                 <div class="pageNumber">
                                
                            	<a href="SearchPage.aspx?keyword=<%=keyword %>&CateID=<%=cateID %>&page=1">&laquo; Trang đầu</a>
                                 <%for (var i = iLowerPage; i <= iUpperPage; i++)
                                {%>  
                                  <%if (i != iCurPage)
{%>
                                     <a href="SearchPage.aspx?keyword=<%=keyword %>&CateID=<%=cateID %>&page=<%=i.ToString() %>" class="Number"><%=i.ToString() %></a>
                                  <% } else{%>
                                     <a href="#" class="Current"><%=i.ToString() %></a>
                                 <% } %>
                                <% } %> 
                                <a href="SearchPage.aspx?keyword=<%=keyword %>&CateID=<%=cateID %>&page=<%=iTotalPage %>">Trang cuối &raquo;</a>

                                <div class="clear"></div>
                               </div>
                            <% } %>
                             <!--End Paging-->
                             
                        </div>
                    </div>
</asp:Content>
